<template>
          <el-form-item  class="file"  >
         <el-upload
                    class="upload"
                    drag
                    :show-file-list="true"
                    :action="$store.state.data.uploadurl"
                    multiple
                    :on-change="changepcb"
                    :on-success="success"
                    ref="upload"
                  >
                    <i class="el-icon-upload"></i>
                    <div class="el-upload__text">
                    <span v-html="tishixingxi"></span>
                    </div>
                  </el-upload>
                   </el-form-item >
</template>

<script>

export default {
    data(){
        return {
            i:this.$myF.arrIndex(this.$store.state.data.pcbInfo,"客户型号：")

        }
    },
    computed:{
        tishixingxi:{
                get: function () {
        return this.$store.state.data.pcbNewOrder.file;
      },
      set: function (v) {
        this.$store.state.data.pcbNewOrder.file = v;
      },

        }

    },
    methods:{
       //有文件拖入后就把文件名传到VUEX
        changepcb:function(file, fileList){
            this.tishixingxi=file.name
            this.$store.state.data.pcbInfo[this.i].pcbpara = file.name
            this.$store.state.data.pcbNewOrder.file = file.name

        },
        success:function(response, file, fileList){
            //上传成功后清除 上传列表
             this.$refs.upload.clearFiles();
        }

    }
}
</script>

<style>
.el-col .el-upload-dragger{
  width: 300px;
  height: 160px;
}

.file .el-form-item__content{
  margin-left: 0px !important;

}
 .file {
    margin-bottom: 25px  !important;
}

</style>